#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    connect(ui->button,&QPushButton::clicked,this,&Widget::ButtonHandler);

}

void Widget::ButtonHandler()
{
    if(ui->button->text() == QString("hello world"))
        ui->button->setText("hello Qt");
    else
        ui->button->setText("hello world");
}

Widget::~Widget()
{
    delete ui;
}

